<template>

	<view class="index-page with-tabbar pl-30 pr-30 pt-200 flex flex-direction align-center justify-center">
		<image v-if="detail.content === '审核通过'" class="img-192"
			src="https://xingangtong.oss-cn-beijing.aliyuncs.com/common/202506261fMyVX.png" />
		<image v-else class="img-192" src="https://xingangtong.oss-cn-beijing.aliyuncs.com/common/20250627F3IAQc.png" />
		<div class="fontS28 mt-50">{{ detail.title }}</div>
		<div class="mt-20 fontS30 font-bold ">{{ detail.content }}</div>
	</view>




</template>

<script>

export default {

	data() {
		return {
			detail: null
		}
	},
	computed: {
		userInfo() {
			return this.$store.getters.userInfo || {};
		},
	},
	onLoad(option) {
		getApp().globalData.messageRefresh = true
		if (option.item) {
			this.detail = JSON.parse(option.item)
		}
	},
	methods: {
		async goDetail(item) {
			if (item.type === 2) {
				const { data } = await readMessage(item.id)
				uni.navigateTo({
					url: `/pages/order/detail?orderId=${item.relatedId}`
				})
			}
		},
		async tabClick(index) {
			this.tabIndex = index
			if (index === 1) {
				await this.getList()
			}
		},
		async getList() {
			const { rows } = await getMessage(this.param)
			this.orderList = rows
		},
		handleToChatRoom(item) {
			const toUserId = item.conversationID.replace(/^C2C/, '');
			console.log('item---->', toUserId, item);
			uni.navigateTo({
				url: `/pages/chatroom/chatroom?toUserId=${toUserId}&nick=${item.userProfile.nick}`
			})
		}
	}
}
</script>

<style scoped>
.message-container {
	/* 为自定义tabBar留出空间 */
	/* padding: 0 20upx; */
	padding-bottom: 150upx;
	background: linear-gradient(180deg, #dcffed 100upx, #f7f7f7 300upx);
	min-height: 100vh;
}

.title {
	font-size: 34upx;

}

.message-list {
	/* padding: 0 30px; */
}

.message-item {
	display: flex;
	padding: 20px 0;
	border-bottom: 1px solid #f0f0f0;
}

.avatar {
	min-width: 104upx;
	max-width: 104upx;
	height: 104upx;
	line-height: 104upx;
	border-radius: 50%;
	text-align: center;
	font-size: 36upx;
	margin-right: 30upx;
	color: #fff;
	position: relative;


}

.avatarTip {
	position: absolute;
	right: 10upx;
	top: 5upx;
	width: 16upx;
	height: 16upx;
	background: red;
	border-radius: 50%;

}

.bg-green {
	background: #39B575 !important;
}

.bg-blue {
	background: #259BEC !important;
}

.message-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
}

.message-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.name {
	font-size: 30upx;
	font-weight: 500;
}

.time {
	font-size: 26upx;
	color: #999;
}

.message-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10upx;
}

.last-message {
	font-size: 28upx;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: calc(100% - 120upx);
}

.unread-badge {
	background-color: #ff5a5f;
	color: #fff;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 12px;
	padding: 0 6px;
}
</style>
